<template>
  <!-- 雷达图  图表必须给高和宽度-->
  <div ref="myDiv" class="radar-echart" />
</template>

<script>
export default {
  // 挂载点
  mounted() {
    this.drawRadar()
  },
  // 绘制图标
  methods: {
    drawRadar() {
    // 1.基于准备好的dom，初始化echarts实例
    // 实例：柱状图
      var myChart = this.echarts.init(this.$refs.myDiv)
      // 绘制图表
      const opt = {
        tooltip: {},
        radar: {
          axisName: {
            color: '#fff',
            backgroundColor: '#999',
            borderRadius: 3,
            padding: [3, 5]
          },
          indicator: [
            { name: '工作效率', max: 100 },
            { name: '考勤', max: 100 },
            { name: '积极性', max: 100 },
            { name: '帮助同事', max: 100 },
            { name: '自主学习', max: 100 },
            { name: '正确率', max: 100 }
          ]
        },
        series: [{
          type: 'radar',
          data: [
            {
              value: [10, 1, 100, 5, 100, 0],
              name: '张三'
            },
            {
              value: [50, 50, 50, 50, 50, 10],
              name: '李四'
            }
          ]
        }]
      }
      myChart.setOption(opt)
    }
  }

}
</script>

<style>
.radar-echart {
    width: 100%;
    height: 400px;
}
</style>
